﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Nancy;
using Nancy.Security;
using Nancy.ModelBinding;
using PlatWL.Data;
using PlatWL.Services.ServicesWeb;

namespace PlatWL.Modules.Web
{
    public class AdvertModule : MsgModule
    {
        public AdvertModule(AdvertManage service) : base("adv")
        {
            Get["/list/{type}/{top:int}"] = p =>
            {
                service.GetHotList(ref msg, Client, p.type, p.top);
                return Response.AsJson(msg);
            };

            Get["/model/{id:int}"] = p =>
            {
                service.GetModel(ref msg, Client, p.id);
                return Response.AsJson(msg);
            };

        }
    }
}